package com.icehelper.hades.base.util.config;

import java.net.URL;

public class ClassPathSearch implements PathSearcher {

    private static ClassPathSearch INSTANCE = new ClassPathSearch();

    private ClassPathSearch() {

    }

    public static ClassPathSearch getInstance() {
        return INSTANCE;
    }

    public URL getURLByName(String name) {
        URL url;
        url = ClassPathSearch.class.getClassLoader().getResource(name);
        if (url == null) {
            url = ClassLoader.getSystemClassLoader().getResource(name);
        }
        return url;
    }
}
